-- slime_airship
-- created by xinj
-- 恶魔丸研究

return {
    canDevelop = function(id)
        local level = SkyRelicFunctionM.getLevel(id);
        -- 玩家的掠夺成功次数
        local relicNum = ME.user.dbase:query("total_rob_win_times", 0);

        -- 需求次数
        local requireNums = {5, 20, 40, 80, 150, 300, 450, 600, 750};
        if relicNum < requireNums[level+1] then
            return false;
        end

        return true;
    end,

    -- 其它限制
    limitDevelopDesc = function(id)
        local level = SkyRelicFunctionM.getLevel(id);
        -- 玩家的掠夺成功次数
        local relicNum = ME.user.dbase:query("total_rob_win_times", 0);
        -- 需求次数
        local requireNums = {5, 20, 40, 80, 150, 300, 450, 600, 750};

        return string.format(getLocStr("airship_limit_rob_times"), requireNums[level+1], relicNum);
    end,

    -- 获取描述
    getDesc = function(desc)
        -- 获取数量
        local level = SkyRelicFunctionM.getLevel(41);
        -- 需要显示下级效果
        level = level + 1;
        local count = FormulaM.invoke("CALC_AIRSHIP_SCRAP_NUM", ME.user, level);

        desc = string.gsub(desc, "{0}", tostring(count));
        return desc;
    end,
};
